import request from '@/utils/request'

// 查询关键词回复列表
export function listReply(query) {
  return request({
    url: '/bot/reply/list',
    method: 'get',
    params: query
  })
}

// 查询关键词回复详细
export function getReply(id) {
  return request({
    url: '/bot/reply/' + id,
    method: 'get',
    headers:{
      custom:{
        showLoading:true
      }
    }
  })
}

// 新增关键词回复
export function addReply(data) {
  return request({
    url: '/bot/reply',
    method: 'post',
    data: data
  })
}

// 修改关键词回复
export function updateReply(data) {
  let mData = JSON.stringify(data);
  let params = JSON.parse(mData);
  params.config = JSON.stringify(params.config)
  return request({
    url: '/bot/reply',
    method: 'put',
    data: params,
    headers:{
      custom:{
        showLoading:true
      }
    }
  })
}

// 删除关键词回复
export function delReply(id) {
  return request({
    url: '/bot/reply/' + id,
    method: 'delete'
  })
}
